package com.tiany.java_study;

//测试类
public class PersonTest {
    public static void main(String[] args) {
        //类的实例化
        Person p1 = new Person();
        //成员变量
        p1.name = "Tom";
        p1.age = 18;
        p1.isMale = true;
        //成员方法
        p1.eat("banana");
        p1.talk("delicious");
        /* ********************************** */
        Person p2 = new Person();
        p2.eat("apple");
        p2.sleep();
        Student student = new Student();
        student.name = "jack";
        student.talk("chinese");
        /* ************************************ */
        /*
         * Person p3=p1;//相当于把地址给p3了
         *p3.age=6;
         *System.out.println(p3.age);
         */
        System.out.println(p1.age);

    }

}

